package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.LuntaiNewsMapper;
import com.ruoyi.system.domain.LuntaiNews;
import com.ruoyi.system.service.ILuntaiNewsService;

/**
 * 新闻Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-17
 */
@Service
public class LuntaiNewsServiceImpl implements ILuntaiNewsService 
{
    @Autowired
    private LuntaiNewsMapper luntaiNewsMapper;

    /**
     * 查询新闻
     * 
     * @param id 新闻主键
     * @return 新闻
     */
    @Override
    public LuntaiNews selectLuntaiNewsById(Integer id)
    {
        return luntaiNewsMapper.selectLuntaiNewsById(id);
    }

    /**
     * 查询新闻列表
     * 
     * @param luntaiNews 新闻
     * @return 新闻
     */
    @Override
    public List<LuntaiNews> selectLuntaiNewsList(LuntaiNews luntaiNews)
    {
        return luntaiNewsMapper.selectLuntaiNewsList(luntaiNews);
    }

    /**
     * 新增新闻
     * 
     * @param luntaiNews 新闻
     * @return 结果
     */
    @Override
    public int insertLuntaiNews(LuntaiNews luntaiNews)
    {
        luntaiNews.setCreateTime(DateUtils.getNowDate());
        return luntaiNewsMapper.insertLuntaiNews(luntaiNews);
    }

    /**
     * 修改新闻
     * 
     * @param luntaiNews 新闻
     * @return 结果
     */
    @Override
    public int updateLuntaiNews(LuntaiNews luntaiNews)
    {
        return luntaiNewsMapper.updateLuntaiNews(luntaiNews);
    }

    /**
     * 批量删除新闻
     * 
     * @param ids 需要删除的新闻主键
     * @return 结果
     */
    @Override
    public int deleteLuntaiNewsByIds(Integer[] ids)
    {
        return luntaiNewsMapper.deleteLuntaiNewsByIds(ids);
    }

    /**
     * 删除新闻信息
     * 
     * @param id 新闻主键
     * @return 结果
     */
    @Override
    public int deleteLuntaiNewsById(Integer id)
    {
        return luntaiNewsMapper.deleteLuntaiNewsById(id);
    }
}
